package com.haoting.mamba.ucenter.service.impl;

import org.apache.commons.codec.digest.Md5Crypt;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class test {

    public static void main(String[] args) {
//        ExecutorService threadPool = Executors.newSingleThreadExecutor();
//        ExecutorService threadPool = Executors.newCachedThreadPool();
//        try {
//           for (int i = 0; i < 10; i++) {
//               threadPool.execute(() -> {
//                   System.out.println(Thread.currentThread().getName() + "ok");
//               });
//           }
//       }catch (Exception e){
//                    e.printStackTrace();
//       }finally {
//                threadPool.shutdown();
//       }
        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        boolean matches = passwordEncoder.matches("123456","$2a$10$hhHHMGn1k436yZ6NhYKB6ukzvEeZafK19/NMAeWzZCaS86yon0fam");
        System.out.println(passwordEncoder.encode("123456")+matches);
//        $2a$10$hhHHMGn1k436yZ6NhYKB6ukzvEeZafK19/NMAeWzZCaS86yon0fam
    }
}
